{include file="public/header" /}
</head>
<body>
<div class="x-body">
	<form action="{:URL(request()->controller().'/save',['id'=>$info.id])}" class="layui-form layui-form-pane" id="form">
		<div class="layui-form-item">
			<label class="layui-form-label"><span class="x-red">*</span>配置标识</label>
			<div class="layui-input-block">
				<input type="text" name="name" value="{$info.name}" placeholder="用于config函数调用，只能使用英文且不能重复" lay-verify="required" class="layui-input"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label"><span class="x-red">*</span>配置标题</label>
			<div class="layui-input-block">
				<input type="text" name="title" value="{$info.title}" placeholder="用于后台显示的配置标题" lay-verify="required" class="layui-input"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label"><span class="x-red">*</span>配置描述</label>
			<div class="layui-input-block">
				<input type="text" name="remark" value="{$info.remark}" placeholder="配置描述" lay-verify="required" class="layui-input"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label"><span class="x-red">*</span>配置类型</label>
			<div class="layui-input-inline">
				<select name="type" lay-filter="call_type">
					<option value="">请选择</option>
					<?php foreach(get_config_type() as $k=>$v){?>
						<option <?php if($k == $info['type']){?>selected <?php }?> value="<?php echo $k; ?>"><?php echo $v; ?></option>
					<?php }?>
				</select>
			</div>
		</div>

		<div class="layui-form-item" id="suffix" {if !$info.suffix}style="display: none;" {/if}>
			<label class="layui-form-label"><span class="x-red">*</span>后缀</label>
			<div class="layui-input-inline">
				<select name="suffix">
					<option value="">请选择</option>
					<?php foreach($suffix as $k=>$v){?>
					<option <?php if($v == $info['suffix']){?>selected <?php }?> value="<?php echo $v; ?>"><?php echo $v; ?></option>
					<?php }?>
				</select>
			</div>
			<span style="float:left;margin-top: 10px;" >
				显示在配置值的后边；例如:200 元, 20 %, 10 个, 5 天</a>
			</span>
		</div>



		<div class="layui-form-item" id="time_format" {if !$info.format}style="display: none" {/if}>
			<label class="layui-form-label"><span class="x-red">*</span>时间格式</label>
			<div class="layui-input-inline">
				<select name="format">
					<option value="">请选择</option>
					<?php foreach($layer_date as $k=>$v){?>
					<option <?php if($k == $info['format']){?>selected <?php }?> value="<?php echo $k; ?>"><?php echo $v; ?></option>
					<?php }?>
				</select>
			</div>
			<span style="float:left;margin-top: 10px;" >
				具体样式参考:<a target="_blank" href="https://www.layui.com/demo/laydate.html">https://www.layui.com/demo/laydate.html</a>
			</span>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label"><span class="x-red">*</span>配置分组</label>
			<div class="layui-input-inline">
				<select name="group">
					<option value="0">请选择</option>
					<?php foreach(get_config_group() as $k=>$v){?>
					<option <?php if($k == $info['group']){?>selected <?php }?> value="<?php echo $k; ?>"><?php echo $v; ?></option>
					<?php }?>
				</select>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label"><span class="x-red">*</span>配置值</label>
			<div class="layui-input-block">
				<input type="text" name="value" {if !$info.format}value="{$info.value}"{/if} placeholder="用于config函数调用显示的值如果是日期型需添加后在编辑日期" class="layui-input"/>
			</div>
		</div>


		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">配置项</label>
			<div class="layui-input-block">
				<textarea class="layui-textarea" name="extra" placeholder="如果是枚举型 需要配置该项">{$info.extra}</textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label"><span class="x-red">*</span>排序</label>
			<div class="layui-input-block">
				<input type="text" name="sort" value="{$info.sort}" placeholder="用于显示的顺序" lay-verify="required" class="layui-input"/>
			</div>
		</div>

		<div class="layui-form-item" style="text-align: center;">
			<button class="layui-btn" lay-filter="save" lay-submit formObj="#form">保存</button>
		</div>
	</form>
</div>
</body>
</html>